<template>
  <div class="box">
    <div>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item><img :src="$route.query.img" alt="" /></van-swipe-item>
        <van-swipe-item><img :src="$route.query.img" alt="" /></van-swipe-item>
        <van-swipe-item><img :src="$route.query.img" alt="" /></van-swipe-item>
        <van-swipe-item><img :src="$route.query.img" alt="" /></van-swipe-item>
      </van-swipe>
    </div>
    <div class="center">
      <div class="bt">
        {{ $route.query.title }}
      </div>
      <div class="del">
		<li>均价: <span>{{ $route.query.price }}</span></li>
		<li>开盘时间: <span>2018-04-02</span></li>
		<li>地址: {{ $route.query.address }}</li>
		<li>开发商: 富力地产在</li>
		<li>物流公司: 富力地产在</li>
        <li class="lis">物业费:<span>暂无资料</span>物业类型:<span>暂无资料</span></li>
        <li class="lis">产权年限:<span> 暂无资料</span>建筑类型:<span>暂无资料</span></li>
        <li class="lis">占地面积:<span>暂无资料</span>建筑面积:<span>暂无资料</span></li>
        <li>车位情况:</li>
        <li>计划户数:暂无资料</li>
        <li>预售证号:有</li>
      </div>
      <div class="hods">
        <h2>房源介绍</h2>
        <div class="dianq">
          <p>{{ $route.query.info }}</p>
        </div>
      </div>
      <div class="Mapsd">
        <h2>位置周边</h2>
        <div style="width: 100%; height: 200px; margin-top: 20px">
          <Map></Map>
        </div>
      </div>
      <div class="like">
        <h2>猜你喜欢</h2>
        <div class="xinf" v-for="(item, index) in lists" :key="index">
          <div class="xinimg">
            <img :src="item.img" alt="" />
          </div>
          <div class="right">
            <div class="p1">
              <span>{{ item.title }}</span>
            </div>
            <p class="p2">
              <span class="span2">{{ item.city }}</span>
              <span class="span3">
                <b>{{ item.price }}</b>
              </span>
            </p>
            <p class="p3">
              {{ item.room }}室{{ item.living_room }}厅{{ item.acreage }}
            </p>
            <p class="p3">{{ item.address }}</p>
          </div>
        </div>
      </div>
    </div>
    <van-goods-action>
      <van-goods-action-icon icon="like-o" text="关注" />
      <van-goods-action-icon icon="chat-o" text="咨询" color="#ee0a24" />
      <van-goods-action-button color="#00ac00"  style="border-radius: 0%;" text="地图导航" />
      <van-goods-action-button color="#f60" style="border-radius: 0%;"  text="预约看房" />
    </van-goods-action>
  </div>
</template>
  <script>
import axios from "axios";
import Map from '../../components/map.vue'
export default {
  data() {
    return {
      obj: {},
      lists: [],
    };
  },
  mounted() {
    axios.get("http://api.shbwyz.com/api/house.html").then((res) => {
      let aa = res.data.data.find((item) => {
        return (item.id = this.obj);
      });
      console.log(aa, "新");
      this.obj = aa;
      this.data = res.data.data;
      console.log(this.obj, "6666666");
    });
    //新数据
    axios.get("http://api.shbwyz.com/api/house.html").then((res) => {
      this.lists = res.data.data.slice(2, 5);
	  console.log(this.lists,'99999');
    });
  },
  methods: {
    ers() {
      this.$router.push("/pages/TwoHome/TwoHome");
    },
  },
  components: {
    Map
  }
};
</script>
  
  <style>
.my-swipe {
  width: 100%;
  height: 13rem;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  /* background-color: #39a9ed; */
}
.my-swipe img {
  width: 100%;
  height: 100%;
}
.box {
  width: 100%;
  background: rgb(108, 104, 104);
  margin-bottom: 3.5rem;
}
.center {
  background: #fff;
  margin-bottom: 0.629864rem;
  padding-left: 0.87888rem;
  padding-right: 0.937472rem;
}
.bt {
  font-size: 1.31832rem;
  line-height: 1.874944rem;
  color: #2c2c2d;
  font-weight: 400;
  padding: 0.7324rem 1.61128rem;
}
.gj {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.gj div {
  width: 33.3%;
  padding-top: 0.87888rem;
  padding-bottom: 0.80564rem;
}
.gj div p {
  color: #999;
}
.gj div b {
  font-size: 1.186488rem;
  color: #00ac00;
}
.del {
  list-style: none;
  line-height: 1.75rem;
  padding-bottom: 0.7324rem;
  padding-top: 0.7324rem;
  background: #fff;
  font-size: 15px;
}
.lis {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}
.lis span {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  color: #999;
}
.hods {
  background: #fff;
  height: 200px;
  margin-top: 20px;
  list-style: none;
}
.dianq {
  margin-top: 20px;
}
.xinf {
  width: 95%;
  height: 100px;
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}
.xinimg {
  width: 30%;
  height: 100px;
  margin-left: 5%;
}
.xinimg img {
  width: 100%;
  height: 90px;
}
.right {
  width: 65%;
  margin-left: 5%;
  height: 200px;
}
.span1 {
  background: rgb(61, 202, 32);
  padding: 3px;
  margin: 0px 5px;
  color: #fff;
}
.p1 {
  font-size: 12px;
}
.p2 {
  display: flex;
  justify-content: space-between;
}
.span2 {
  font-size: 12px;
  color: rgb(178, 176, 176);
}
.span3 {
  color: rgb(42, 183, 56);
}
.p3 {
  font-size: 12px;
  color: rgb(178, 176, 176);
}
.p4 {
  display: flex;
  flex-wrap: wrap;
}
.p4 span {
  font-size: 12px;
  padding: 2px;
  margin: 2px;
}
.Mapsd {
  width: 100%;
  height: 240px;
  margin-bottom: 40px;
}
</style>
  